home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / patch12.zip / MAKEFILE.SH < prev    next >
Text File  |  1990-05-30  |  2KB  |  100 lines

  1. case $CONFIG in
  2.     '') . config.sh ;;
  3. esac
  4. echo "Extracting Makefile (with variable substitutions)"
  5. cat >Makefile <<!GROK!THIS!
  6. # $Header: Makefile.SH,v 2.0.1.2 88/06/22 20:43:40 lwall Locked $
  7. #
  8. # $Log:    Makefile.SH,v $
  9. # Revision 2.0.1.2  88/06/22  20:43:40  lwall
  10. # patch12: config.h now depends on config.h.SH
  11. # Revision 2.0.1.1  88/06/03  15:00:48  lwall
  12. # patch10: upgraded to match some new metaconfig stuff
  13. # Revision 2.0  86/09/17  15:36:15  lwall
  14. # Baseline for netwide release.
  15. # Revision 1.2  86/09/08  14:07:42  lwall
  16. # Split up patch.c.
  17. # Revision 1.1  86/08/01  20:18:35  lwall
  18. # Initial revision
  19.  
  20. CC = $cc
  21. bin = $bin
  22. mansrc = $mansrc
  23. manext = $manext
  24. CFLAGS = $ccflags -O
  25. LDFLAGS = $ldflags
  26. SMALL = $small
  27. LARGE = $large $split
  28.  
  29. !GROK!THIS!
  30. cat >>Makefile <<'!NO!SUBS!'
  31.  
  32. public = patch
  33. private = 
  34. manpages = patch.man
  35. util = Makefile
  36.  
  37. c = patch.c pch.c inp.c version.c util.c
  38.  
  39. obj = patch.o pch.o inp.o util.o version.o
  40.  
  41. lintflags = -phbvxac
  42.  
  43. addedbyconf = Makefile.old bsd config.h config.sh eunice loc pdp11 usg v7
  44.  
  45. # grrr
  46. SHELL = /bin/sh
  47.  
  48. .c.o:
  49.     $(CC) -c $(CFLAGS) $(LARGE) $*.c
  50.  
  51. all: $(public) $(private) $(util)
  52.     touch all
  53.  
  54. patch: $(obj)
  55.     $(CC) $(LDFLAGS) $(obj) $(libs) -o patch
  56.  
  57. config.h: config.h.SH
  58.     sh config.h.SH
  59.  
  60. # won't work with csh
  61. install: patch
  62.     export PATH || exit 1
  63.     - mv $(bin)/patch $(bin)/patch.old
  64.     - if test `pwd` != $(bin); then cp $(public) $(bin); fi
  65.     cd $(bin); chmod 755 $(public)
  66.     - if test `pwd` != $(mansrc); then \
  67. for page in $(manpages); do \
  68. rm -f $(mansrc)/../cat$(manext)/`basename $$page .man`.$(manext); \
  69. cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
  70. done; \
  71. fi
  72.  
  73. clean:
  74.     rm -f *.o *.orig core
  75.  
  76. realclean:
  77.     rm -f patch *.o *.orig *~ core $(addedbyconf)
  78.  
  79. # The following lint has practically everything turned on.  Unfortunately,
  80. # you have to wade through a lot of mumbo jumbo that can't be suppressed.
  81. # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
  82. # for that spot.
  83.  
  84. lint:
  85.     lint $(lintflags) $(defs) $(c) > patch.fuzz
  86.  
  87. patch.o: config.h common.h patch.c inp.h pch.h util.h version.h
  88. pch.o: config.h common.h pch.c pch.h util.h
  89. inp.o: config.h common.h inp.c inp.h util.h
  90. util.o: config.h common.h util.c util.h
  91. version.o: config.h common.h version.c version.h patchlevel.h util.h
  92.  
  93. !NO!SUBS!
  94. $eunicefix Makefile
  95.